import { request } from "@/utils/service"
import * as Authority from "./types/authority"

/**
 * 获取某人的权限
 * @param id
 * @returns
 */
export function getOneAuthorityDataApi(id: number) {
  return request<Authority.GetAnyConstantResponseData>({
    url: `authority/getOneAuthority?id=${id}`,
    method: "get"
  })
}

/**
 * 更新某人的权限
 * @param data
 * @returns
 */
export function updateGrantDataApi(data: Authority.IUpdateGrantRequestData) {
  return request<Authority.GetAnyConstantResponseData>({
    url: `authority/updateGrant`,
    method: "put",
    data
  })
}
